<template>
  <div class="container">
    <div class="container-head flex_btw">
      <div class="head-title flex_x">
        <img class="head-icon" src="@/assets/images/data.png" alt="" />
        <span>新增任务</span>
      </div>
    </div>
    <div class="container-main">
      <el-form :model="formList" label-width="auto" size="large">
        <el-form-item label="名称：">
          <el-col :span="10">
            <el-input v-model="formList.name" placeholder="请输入任务名称"
          /></el-col>
        </el-form-item>
        <el-form-item label="严重程度：">
          <el-radio-group v-model="formList.warn">
            <el-radio value="">警告</el-radio>
            <el-radio value="Venue">严重</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item>
          <div class="ml20 mr10">第一级：</div>
          <el-col :span="4" class="mr30">
            <el-select
              v-model="formList.bm"
              placeholder="please select your zone"
            >
              <el-option label="部门" value="" />
              <el-option label="Zone two" value="beijing" />
            </el-select>
          </el-col>
          <el-col :span="4" class="mr30">
            <el-select
              v-model="formList.zw"
              placeholder="please select your zone"
            >
              <el-option label="职务" value="" />
              <el-option label="Zone two" value="beijing" />
            </el-select>
          </el-col>
          <el-col :span="4">
            <el-select
              v-model="formList.yg"
              placeholder="please select your zone"
            >
              <el-option label="指定员工" value="" />
              <el-option label="Zone two" value="beijing" />
            </el-select>
          </el-col>
          <el-col :span="4" class="ml30">
            <el-button type="primary" :icon="Plus" circle size="small" />
            <!-- <el-button type="danger" :icon="Minus" circle size="small" /> -->
          </el-col>
        </el-form-item>
        <el-form-item label="提醒：">
          <div class="cf5" >临期：</div>
            <el-input
              v-model="formList.limitNum"
              class="num_ipt"
              placeholder="Please input"
            />
          <el-col :span="2" class="mr30">
            <el-select
              v-model="formList.date"
              placeholder="please select your zone"
            >
              <el-option label="日" value="" />
              <el-option label="Zone two" value="beijing" />
            </el-select>
          </el-col>
          <div class="cf5">超期：</div>
            <el-input
              v-model="formList.limitNum"
              class="num_ipt"
              placeholder="Please input"
            />
          <el-col :span="2" class="mr30">
            <el-select
              v-model="formList.date"
              placeholder="please select your zone"
            >
              <el-option label="日" value="" />
              <el-option label="Zone two" value="beijing" />
            </el-select>
          </el-col>
        </el-form-item>

        <el-form-item label="任务内容：">
          <el-col :span="18">
            <el-input v-model="formList.con" type="textarea" :rows="3"/>
          </el-col>
        </el-form-item>
        <el-form-item label="上传附件：">
          <el-upload
            v-model:file-list="fileList"
            class="upload-demo"
            action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
            multiple
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            :limit="3"
            :on-exceed="handleExceed"
          >
            <el-button type="primary">上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">
                支持扩展名:.rar .zip .doc .docx.pdf jpg.
              </div>
            </template>
          </el-upload>
        </el-form-item>
      </el-form>
      <div class="flex_c">
        <el-button size="large" @click="router.back()">取消</el-button>
        <el-button size="large" type="primary" @click="onSubmit">保存</el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Search } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
import { Plus, Minus } from "@element-plus/icons-vue";
const router = useRouter();
const params = ref("");
const formList = reactive({
  name: "",
  target: "指标单数",
  range: "店铺",
  store: "",
  limit: "",
  limitNum: "0",
  date: "",
  warn: "",
  con: "",
  bm: "",
  zw: "",
  yg: "",
});
const onSubmit = () => {
  console.log("submit!");
};
</script>
<style lang="scss" scoped></style>
